<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
解析cookie
<%
String name="";
//获取所有的cookie
Cookie[] cookies=request.getCookies();
if(cookies !=null){
	for(int i=0;i<cookies.length;i++){
		if("name".equals(cookies[i].getName())){//根据key查找要找的cookie
			name=cookies[i].getValue();   //获取cookie的value值
		}
	}
}

%>
</head>
<body>
	<form action="doRegister.jsp" method="post">
		用户名：<input type="text" name="uname" value="<%=name%>"><br/>
		密码:<input type="password" name="pwd" ><br/>
		<button type="submit">注册</button>
	</form>
</body>
</html>